package com.ruoyi.web.core.config;

import com.google.api.services.youtube.YouTube;
import com.ruoyi.setlanguages.service.YouTubeManager;
import com.ruoyi.setlanguages.until.YouTubeAuth;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.IOException;
import java.security.GeneralSecurityException;

@Configuration
public class YouTubeConfig {

    @Bean
    public YouTube youTubeService() {
        try {
            return YouTubeAuth.getYouTubeService();
        } catch (IOException | GeneralSecurityException e) {
            throw new RuntimeException("无法初始化YouTube服务", e);
        }
    }


}